//
// Created by Administrator on 2024/1/27.
//
#include <vector>
#include <iostream>
#include <unordered_map>
using namespace std;


class Solution
{
public:
    int countElements(vector<int>& nums)
    {
        unordered_map<int, int> um;
        int nums_max = -1000000;
        int nums_min = 1000000;
        for (auto n : nums)
        {
            um[n]++;
            nums_max = max(n, nums_max);
            nums_min = min(n, nums_min);
        }

        int ans = nums.size() - um[nums_max] - um[nums_min];
        return ans > 0 ? ans : 0;
    }
};

int main()
{
    Solution solution;
    vector<int> nums{3,3,3,3,3,3,};
    cout << solution.countElements(nums) << endl;
    return 0;
}
